xl: detect pci-insert-failed dm status on pci-passthrough
authorGianni Tedesco <gianni.tedesco@citrix.com>
Wed, 4 Aug 2010 13:43:46 +0000 (14:43 +0100)
committerGianni Tedesco <gianni.tedesco@citrix.com>
Wed, 4 Aug 2010 13:43:46 +0000 (14:43 +0100)
commit072186cf673d593478aced4614be65d19f459818
tree70e6abc97b305b221a8b76e63ed5528a6ec99216
parentd6353658b26249c50f8ae5c3b9861693f64e3446
xl: detect pci-insert-failed dm status on pci-passthrough

NOTE: This functionality depends on a corresponding qemu-dm patch to work as
expected. Should be safe to use with an un-patched qemu-dm as before.

libxl_wait_for_device_model can only wait for one status value, re-work the
API so that a callback function can chose between several different possible
status values for qemu-dm and fix up all callers appropriately.

In the case of PCI device insert we succeed if qemu-dm reports
"pci-device-inserted" and error out instead of hanging forever if it fails
since qemu-dm now reports a status of "pci-insert-failed".

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl_device.c
tools/libxl/libxl_internal.h
tools/libxl/libxl_pci.c